/**
 * KopsoxFramework
 * Copyright (C) 2010 Free Software Foundation, Inc. <http://fsf.org/>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.kopsox.data.container;

import java.util.Collection;
import java.util.List;

import org.kopsox.comm.message.ErrorMessage;
import org.kopsox.validation.ContainerValidator;
import org.kopsox.validation.Validateable;

/**
 * @author Konrad Renner - 24.06.2010
 *
 */
public interface ValidateableContainer {

	/**
	 * Registers a ContainerValidator
	 * 
	 * @param validator
	 */
	public void addContainerValidator(final ContainerValidator validator);
	
	/**
	 * Registers  ContainerValidators
	 * 
	 * @param validator
	 */
	public void addAllContainerValidators(final Collection<ContainerValidator> validator);
	
	/**
	 * Removes a ContainerValidator
	 * 
	 * @param validator
	 */
	public void removeContainerValidator(final ContainerValidator validator);
	
	/**
	 * true if the specified ContainerValidator is registered
	 * 
	 * @param validator
	 * @return boolean
	 */
	public boolean isContainerValidatorRegistered(final ContainerValidator validator);
	
	/**
	 * Validates the Container.<br>
	 * Calls every ContainerValidator which is registered, <b>does not call the Validators from the Values.</b><br>
	 * 
	 * @return boolean
	 */
	public boolean validateContainer();
	
	/**
	 * Returns all Errors from Validations
	 * 
	 * @return List<ErrorMessage>
	 */
	public List<ErrorMessage> getValidationErrors();

	/**
	 * Gets all Values for Validation
	 * 
	 * @return Collection<? extends Validateable>
	 */
	public Collection<? extends Validateable> getValuesForValidation();
}
